package org.example.mapper;

import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.example.pojo.PageResult;
import org.example.pojo.Student;
import org.example.pojo.StudentQueryParam;

import java.util.List;
import java.util.Map;

@Mapper
public interface StudentMapper {
    /*
    * 条件分页查询
    * */
    public List<Student> page(StudentQueryParam studentQueryParam);

    /*
    * 新增学员
    * */
    public void add(Student student);

    /*
    * 根据ID查询学生
    * */
    public Student getById(Integer id);

    /*
    * 删除学生
    * */
    public void deleteByIds(List<Integer> ids);

    /*
    * 计算每个班内有多少学生
    * */
    int countByClazzId(Integer id);

    /*
    * 处理违纪
    * */
    void updateViolation(Student student);

    /*
    * 统计学员学历
    * */
    @MapKey("name")
    List<Map<String, Object>> countStudentDegreeData();

    /*
    * 班级人数统计
    * */
    @MapKey("name")
    List<Map<String, Object>> countStudentCountData();
}
